# electricity consumption data at MSOA level (pre downloaded)
inFile <-paste0(dataFolder, "energy/MSOA_DOM_ELEC_2019.csv")
msoa_elecData <- readr::read_csv(inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `Local Authority Name` = col_character(),
## `Local Authority Code` = col_character(),
## `MSOA Name` = col_character(),
## `Middle Layer Super Output Area (MSOA) Code` = col_character(),
## `Number of meters` = col_double(),
## `Consumption (kWh)` = col_double(),
## `Mean consumption (kWh per meter)` = col_double(),
## `Median consumption (kWh per meter)` = col_double()
## )
head(msoa_elecData)
## # A tibble: 6 x 8
## `Local Authority N… `Local Authority … `MSOA Name` `Middle Layer Super Outpu…
## <chr> <chr> <chr> <chr>
## 1 Hartlepool E06000001 Hartlepool … E02002483
## 2 Hartlepool E06000001 Hartlepool … E02002484
## 3 Hartlepool E06000001 Hartlepool … E02002485
## 4 Hartlepool E06000001 Hartlepool … E02002487
## 5 Hartlepool E06000001 Hartlepool … E02002488
## 6 Hartlepool E06000001 Hartlepool … E02002489
## # … with 4 more variables: Number of meters <dbl>, Consumption (kWh) <dbl>,
## # Mean consumption (kWh per meter) <dbl>,
## # Median consumption (kWh per meter) <dbl>
inf <-paste0(dataFolder, "boundaries/MSOA/msoa_solent.shp")
message("Loading Middle Layer Super Output Area (MSOA) from file")
## Loading Middle Layer Super Output Area (MSOA) from file
#When using shp files you might also need to have other supplementary files in the same folder to allow it to run https://cfss.uchicago.edu/notes/simple-features/
msoa_sf_data <- sf::read_sf(inf)
head (msoa_sf_data)
## Simple feature collection with 6 features and 13 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 458985.4 ymin: 102894 xmax: 467725.4 ymax: 107035
## Projected CRS: OSGB 1936 / British National Grid
## # A tibble: 6 x 14
## MSOA11CD MSOA11NM OBJECTID BNG_E BNG_N LONG_ LAT Shape_Leng Shape__Are
## <chr> <chr> <int> <int> <int> <dbl> <dbl> <dbl> <dbl>
## 1 E02003524 Portsmouth… 3510 463726 106331 -1.10 50.9 8175. 1880016.
## 2 E02003525 Portsmouth… 3511 465172 105904 -1.08 50.8 13220. 2012966.
## 3 E02003526 Portsmouth… 3512 466581 106095 -1.06 50.9 10425. 2260228.
## 4 E02003527 Portsmouth… 3513 464176 104420 -1.09 50.8 21957. 3838768.
## 5 E02003529 Portsmouth… 3514 466420 104925 -1.06 50.8 10636. 1499618.
## 6 E02003530 Portsmouth… 3515 465411 103721 -1.07 50.8 13264. 1695461.
## # … with 5 more variables: Shape__Len <dbl>, LAD11CD <chr>, LAD11NM <chr>,
## # nOAs <int>, geometry <MULTIPOLYGON [m]>
table(msoa_sf_data$LAD11NM)#how many MSOAs are in each LA
##
## Basingstoke and Deane East Hampshire Eastleigh
## 22 15 15
## Fareham Gosport Hart
## 14 10 11
## Havant Isle of Wight New Forest
## 17 18 23
## Portsmouth Southampton Test Valley
## 25 32 15
## Winchester
## 14
msoa_elecData$MSOA11CD <- msoa_elecData$ 'Middle Layer Super Output Area (MSOA) Code' #Creating a variable with the LA code and the name as in the sf_data
msoa_merged_sf <-merge(msoa_sf_data, msoa_elecData)
ggplot2::ggplot(msoa_merged_sf) +
geom_sf(aes(fill = `Mean consumption (kWh per meter)`)) +
scale_fill_continuous(name = "Electricity: Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Solent (all MSOAs)")
#mapping it
# gas consumption data at MSOA level (pre downloaded)
inFile <-paste0(dataFolder, "energy/MSOA_GAS_2019.csv")
msoa_gasData <- readr::read_csv(inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `Local Authority Name` = col_character(),
## `Local Authority Code` = col_character(),
## `MSOA Name` = col_character(),
## `Middle Layer Super Output Area (MSOA) Code` = col_character(),
## `Number of consuming meters` = col_double(),
## `Consumption (kWh)` = col_double(),
## `Mean consumption (kWh per meter)` = col_double(),
## `Median consumption (kWh per meter)` = col_double(),
## `Number of non consuming meters` = col_character()
## )
head(msoa_gasData)
## # A tibble: 6 x 9
## `Local Authority N… `Local Authority … `MSOA Name` `Middle Layer Super Outpu…
## <chr> <chr> <chr> <chr>
## 1 Hartlepool E06000001 Hartlepool … E02002483
## 2 Hartlepool E06000001 Hartlepool … E02002484
## 3 Hartlepool E06000001 Hartlepool … E02002485
## 4 Hartlepool E06000001 Hartlepool … E02002487
## 5 Hartlepool E06000001 Hartlepool … E02002488
## 6 Hartlepool E06000001 Hartlepool … E02002489
## # … with 5 more variables: Number of consuming meters <dbl>,
## # Consumption (kWh) <dbl>, Mean consumption (kWh per meter) <dbl>,
## # Median consumption (kWh per meter) <dbl>,
## # Number of non consuming meters <chr>
msoa_gasData$MSOA11CD <- msoa_gasData$ 'Middle Layer Super Output Area (MSOA) Code'
msoa_merged_sf_domgas <-merge(msoa_sf_data, msoa_gasData)
ggplot2::ggplot(msoa_merged_sf_domgas) +
geom_sf(aes(fill = `Mean consumption (kWh per meter)`)) +
scale_fill_continuous(name = "Gas: Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Solent (all MSOAs)")
#mapping it
Does this match to non-gas areas??
# electricity consumption data for industry at MSOA level (pre downloaded)
inFile <-paste0(dataFolder, "energy/MSOA_NONDOM_2019.csv")
msoa_elecDatanondom <- readr::read_csv(inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `Local Authority Name` = col_character(),
## `Local Authority Code` = col_character(),
## `MSOA Name` = col_character(),
## `Middle Layer Super Output Area (MSOA) Code` = col_character(),
## `Number of meters` = col_double(),
## `Consumption (kWh)` = col_double(),
## `Mean consumption (kWh per meter)` = col_double(),
## `Median consumption (kWh per meter)` = col_double()
## )
head(msoa_elecDatanondom)
## # A tibble: 6 x 8
## `Local Authority N… `Local Authority … `MSOA Name` `Middle Layer Super Outpu…
## <chr> <chr> <chr> <chr>
## 1 Hartlepool E06000001 Hartlepool … E02002483
## 2 Hartlepool E06000001 Hartlepool … E02002484
## 3 Hartlepool E06000001 Hartlepool … E02002485
## 4 Hartlepool E06000001 Hartlepool … E02002487
## 5 Hartlepool E06000001 Hartlepool … E02002488
## 6 Hartlepool E06000001 Hartlepool … E02002489
## # … with 4 more variables: Number of meters <dbl>, Consumption (kWh) <dbl>,
## # Mean consumption (kWh per meter) <dbl>,
## # Median consumption (kWh per meter) <dbl>
msoa_elecDatanondom$MSOA11CD <- msoa_elecDatanondom$ 'Middle Layer Super Output Area (MSOA) Code'
msoa_merged_sf_nondom <-merge(msoa_sf_data, msoa_elecDatanondom)
ggplot2::ggplot(msoa_merged_sf_nondom) +
geom_sf(aes(fill = `Mean consumption (kWh per meter)`)) +
scale_fill_continuous(name = "Electricity: Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Solent (all MSOAs)")
#mapping it
# gas consumption data for industry at MSOA level (pre downloaded)
inFile <-paste0(dataFolder, "energy/MSOA_NonDom_Gas_2019.csv")
msoa_gasDatanondom <- readr::read_csv(inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `Local Authority Name` = col_character(),
## `Local Authority Code` = col_character(),
## `MSOA Name` = col_character(),
## `Middle Layer Super Output Area (MSOA) Code` = col_character(),
## `Number of meters` = col_double(),
## `Consumption (kWh)` = col_double(),
## `Mean consumption (kWh per meter)` = col_double(),
## `Median consumption (kWh per meter)` = col_double()
## )
head(msoa_gasDatanondom)
## # A tibble: 6 x 8
## `Local Authority N… `Local Authority … `MSOA Name` `Middle Layer Super Outpu…
## <chr> <chr> <chr> <chr>
## 1 Hartlepool E06000001 Hartlepool … E02002483
## 2 Hartlepool E06000001 Hartlepool … E02002484
## 3 Hartlepool E06000001 Hartlepool … E02002485
## 4 Hartlepool E06000001 Hartlepool … E02002487
## 5 Hartlepool E06000001 Hartlepool … E02002488
## 6 Hartlepool E06000001 Hartlepool … E02002489
## # … with 4 more variables: Number of meters <dbl>, Consumption (kWh) <dbl>,
## # Mean consumption (kWh per meter) <dbl>,
## # Median consumption (kWh per meter) <dbl>
msoa_gasDatanondom$MSOA11CD <- msoa_gasDatanondom$ 'Middle Layer Super Output Area (MSOA) Code'
msoa_merged_sf_nondom_gas <-merge(msoa_sf_data, msoa_gasDatanondom)
ggplot2::ggplot(msoa_merged_sf_nondom_gas) +
geom_sf(aes(fill = `Mean consumption (kWh per meter)`)) +
scale_fill_continuous(name = "Gas: Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Solent (all MSOAs)")
#mapping it
The holes tell you where there is no non-domestic gas use
#Electricty consumption data LSOA pre downloaded
inFile <-paste0(dataFolder, "energy/LSOA_ELEC_2019.csv")
lsoa_elecData <- readr::read_csv(inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `Local Authority Name` = col_character(),
## `Local Authority Code` = col_character(),
## `Middle Layer Super Output Area (MSOA) Name` = col_character(),
## `Middle Layer Super Output Area (MSOA) Code` = col_character(),
## `Lower Layer Super Output Area (LSOA) Name` = col_character(),
## `Lower Layer Super Output Area (LSOA) Code` = col_character(),
## `Total number of domestic electricity meters` = col_double(),
## `Total domestic electricity consumption (kWh)` = col_double(),
## `Mean domestic electricity consumption
## (kWh per meter)` = col_double(),
## `Median domestic electricity consumption
## (kWh per meter)` = col_double()
## )
lsoa_elecData$LSOA11CD <- lsoa_elecData$`Lower Layer Super Output Area (LSOA) Code`
head(msoa_elecData)
## # A tibble: 6 x 9
## `Local Authority N… `Local Authority … `MSOA Name` `Middle Layer Super Outpu…
## <chr> <chr> <chr> <chr>
## 1 Hartlepool E06000001 Hartlepool … E02002483
## 2 Hartlepool E06000001 Hartlepool … E02002484
## 3 Hartlepool E06000001 Hartlepool … E02002485
## 4 Hartlepool E06000001 Hartlepool … E02002487
## 5 Hartlepool E06000001 Hartlepool … E02002488
## 6 Hartlepool E06000001 Hartlepool … E02002489
## # … with 5 more variables: Number of meters <dbl>, Consumption (kWh) <dbl>,
## # Mean consumption (kWh per meter) <dbl>,
## # Median consumption (kWh per meter) <dbl>, MSOA11CD <chr>
#The LSOA boundaries for the Solent have been pre-downloaded
inf<-paste0(dataFolder, "boundaries/LSOA/lsoa_solent.shp")
message ("Loading LSOA boundaries from file")
## Loading LSOA boundaries from file
lsoa_sf_data <- sf::read_sf(inf)
head(lsoa_sf_data)
## Simple feature collection with 6 features and 15 fields
## Geometry type: MULTIPOLYGON
## Dimension: XY
## Bounding box: xmin: 465991.4 ymin: 100849 xmax: 467770.5 ymax: 102360.8
## Projected CRS: OSGB 1936 / British National Grid
## # A tibble: 6 x 16
## LSOA11CD OBJECTID LSOA11NM LSOA11NMW BNG_E BNG_N LONG LAT Shape__Are
## <chr> <int> <chr> <chr> <int> <int> <dbl> <dbl> <dbl>
## 1 E01017013 16519 Portsmout… Portsmouth… 466127 101741 -1.06 50.8 145134.
## 2 E01017014 16520 Portsmout… Portsmouth… 466924 101957 -1.05 50.8 757371.
## 3 E01017015 16521 Portsmout… Portsmouth… 467084 101499 -1.05 50.8 472647.
## 4 E01017016 16522 Portsmout… Portsmouth… 466330 101597 -1.06 50.8 122927.
## 5 E01017017 16523 Portsmout… Portsmouth… 466813 101069 -1.05 50.8 166924.
## 6 E01017018 16524 Portsmout… Portsmouth… 466350 101184 -1.06 50.8 184945.
## # … with 7 more variables: Shape__Len <dbl>, MSOA11CD <chr>, MSOA11NM <chr>,
## # LAD11CD <chr>, LAD11NM <chr>, nLSOAs <int>, geometry <MULTIPOLYGON [m]>
table(lsoa_sf_data$LAD11NM)#How many LSOAs are there in each LA
##
## Basingstoke and Deane East Hampshire Eastleigh
## 109 72 77
## Fareham Gosport Hart
## 73 53 57
## Havant Isle of Wight New Forest
## 78 89 114
## Portsmouth Southampton Test Valley
## 125 148 71
## Winchester
## 70
lsoa_merged_sf <- merge(lsoa_sf_data, lsoa_elecData) #merging the boundaries and energy data
ggplot2::ggplot(lsoa_merged_sf) +
geom_sf(aes(fill = `Mean domestic electricity consumption \n(kWh per meter)`)) +
scale_fill_continuous(name = "Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Solent (all LSOAs)")
#Mapping it
#Cities such as Southampton disappear due to their density, we will now map Southampton alone to see this area in more detail
mapData <- dplyr::filter(lsoa_merged_sf, LAD11NM == "Southampton")
# plotting the electricity consumption of Southampton in more detail
ggplot2::ggplot(mapData) +
geom_sf(aes(fill = `Mean domestic electricity consumption \n(kWh per meter)`)) +
scale_fill_continuous(name = "Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Southampton")
#Electricty consumption data LSOA pre downloaded
inFile <-paste0(dataFolder, "energy/LSOA_GAS_2019.csv")
lsoa_gasData <- readr::read_csv(inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `Local Authority Name` = col_character(),
## `Local Authority Code` = col_character(),
## `MSOA Name` = col_character(),
## `Middle Layer Super Output Area (MSOA) Code` = col_character(),
## `LSOA Name` = col_character(),
## `Lower Layer Super Output Area (LSOA) Code` = col_character(),
## `Number of consuming meters` = col_double(),
## `Consumption (kWh)` = col_double(),
## `Mean consumption (kWh per meter)` = col_double(),
## `Median consumption (kWh per meter)` = col_double(),
## `Number of non-consuming meters` = col_character()
## )
lsoa_gasData$LSOA11CD <- lsoa_gasData$`Lower Layer Super Output Area (LSOA) Code`
head(lsoa_gasData)
## # A tibble: 6 x 12
## `Local Authority… `Local Authority… `MSOA Name` `Middle Layer Sup… `LSOA Name`
## <chr> <chr> <chr> <chr> <chr>
## 1 Hartlepool E06000001 Hartlepool… E02002483 Hartlepool…
## 2 Hartlepool E06000001 Hartlepool… E02002483 Hartlepool…
## 3 Hartlepool E06000001 Hartlepool… E02002483 Hartlepool…
## 4 Hartlepool E06000001 Hartlepool… E02002483 Hartlepool…
## 5 Hartlepool E06000001 Hartlepool… E02002483 Hartlepool…
## 6 Hartlepool E06000001 Hartlepool… E02002483 Hartlepool…
## # … with 7 more variables: Lower Layer Super Output Area (LSOA) Code <chr>,
## # Number of consuming meters <dbl>, Consumption (kWh) <dbl>,
## # Mean consumption (kWh per meter) <dbl>,
## # Median consumption (kWh per meter) <dbl>,
## # Number of non-consuming meters <chr>, LSOA11CD <chr>
lsoa_merged_sf_gas <- merge(lsoa_sf_data, lsoa_gasData) #merging the boundaries and energy data
ggplot2::ggplot(lsoa_merged_sf_gas) +
geom_sf(aes(fill = `Mean consumption (kWh per meter)`)) +
scale_fill_continuous(name = "Gas: Mean kWh per meter", low = "green", high = "red") +
labs(caption = "Solent (all LSOAs)")
#Mapping it
Aha - this one shows where there is no gas :-)
# Multiple deprivation data at MSOA pre downloaded
inFile <-paste0(dataFolder, "Indices of Multiple Deprivation/Indices_of_Multiple_Deprivation_(IMD)_2019.csv")
lsoa_multidep <- readr::read_csv (inFile)
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## .default = col_double(),
## lsoa11cd = col_character(),
## lsoa11nm = col_character(),
## lsoa11nmw = col_character(),
## LSOA01NM = col_character(),
## LADcd = col_character(),
## LADnm = col_character()
## )
## ℹ Use `spec()` for the full column specifications.
head(lsoa_multidep)
## # A tibble: 6 x 66
## FID lsoa11cd lsoa11nm lsoa11nmw st_areasha st_lengths IMD_Rank IMD_Decile
## <dbl> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
## 1 1 E01000816 Bromley … Bromley 0… 299021. 3337. 19874 7
## 2 2 E01000818 Bromley … Bromley 0… 1292309. 7408. 20548 7
## 3 3 E01000819 Bromley … Bromley 0… 397713. 4384. 9866 4
## 4 4 E01000820 Bromley … Bromley 0… 587458. 4838. 13461 5
## 5 5 E01000822 Bromley … Bromley 0… 218524. 2738. 20757 7
## 6 6 E01000823 Bromley … Bromley 0… 242692. 3195. 22675 7
## # … with 58 more variables: LSOA01NM <chr>, LADcd <chr>, LADnm <chr>,
## # IMDScore <dbl>, IMDRank0 <dbl>, IMDDec0 <dbl>, IncScore <dbl>,
## # IncRank <dbl>, IncDec <dbl>, EmpScore <dbl>, EmpRank <dbl>, EmpDec <dbl>,
## # EduScore <dbl>, EduRank <dbl>, EduDec <dbl>, HDDScore <dbl>, HDDRank <dbl>,
## # HDDDec <dbl>, CriScore <dbl>, CriRank <dbl>, CriDec <dbl>, BHSScore <dbl>,
## # BHSRank <dbl>, BHSDec <dbl>, EnvScore <dbl>, EnvRank <dbl>, EnvDec <dbl>,
## # IDCScore <dbl>, IDCRank <dbl>, IDCDec <dbl>, IDOScore <dbl>, IDORank <dbl>,
## # IDODec <dbl>, CYPScore <dbl>, CYPRank <dbl>, CYPDec <dbl>, ASScore <dbl>,
## # ASRank <dbl>, ASDec <dbl>, GBScore <dbl>, GBRank <dbl>, GBDec <dbl>,
## # WBScore <dbl>, WBRank <dbl>, WBDec <dbl>, IndScore <dbl>, IndRank <dbl>,
## # IndDec <dbl>, OutScore <dbl>, OutRank <dbl>, OutDec <dbl>, TotPop <dbl>,
## # DepChi <dbl>, Pop16_59 <dbl>, Pop60_ <dbl>, WorkPop <dbl>,
## # Shape__Area <dbl>, Shape__Length <dbl>
lsoa_multidep$LSOA11CD <- lsoa_multidep$lsoa11cd #creating a variable with the LSOA code in the same name as in sf_data
head(lsoa_multidep)
## # A tibble: 6 x 67
## FID lsoa11cd lsoa11nm lsoa11nmw st_areasha st_lengths IMD_Rank IMD_Decile
## <dbl> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
## 1 1 E01000816 Bromley … Bromley 0… 299021. 3337. 19874 7
## 2 2 E01000818 Bromley … Bromley 0… 1292309. 7408. 20548 7
## 3 3 E01000819 Bromley … Bromley 0… 397713. 4384. 9866 4
## 4 4 E01000820 Bromley … Bromley 0… 587458. 4838. 13461 5
## 5 5 E01000822 Bromley … Bromley 0… 218524. 2738. 20757 7
## 6 6 E01000823 Bromley … Bromley 0… 242692. 3195. 22675 7
## # … with 59 more variables: LSOA01NM <chr>, LADcd <chr>, LADnm <chr>,
## # IMDScore <dbl>, IMDRank0 <dbl>, IMDDec0 <dbl>, IncScore <dbl>,
## # IncRank <dbl>, IncDec <dbl>, EmpScore <dbl>, EmpRank <dbl>, EmpDec <dbl>,
## # EduScore <dbl>, EduRank <dbl>, EduDec <dbl>, HDDScore <dbl>, HDDRank <dbl>,
## # HDDDec <dbl>, CriScore <dbl>, CriRank <dbl>, CriDec <dbl>, BHSScore <dbl>,
## # BHSRank <dbl>, BHSDec <dbl>, EnvScore <dbl>, EnvRank <dbl>, EnvDec <dbl>,
## # IDCScore <dbl>, IDCRank <dbl>, IDCDec <dbl>, IDOScore <dbl>, IDORank <dbl>,
## # IDODec <dbl>, CYPScore <dbl>, CYPRank <dbl>, CYPDec <dbl>, ASScore <dbl>,
## # ASRank <dbl>, ASDec <dbl>, GBScore <dbl>, GBRank <dbl>, GBDec <dbl>,
## # WBScore <dbl>, WBRank <dbl>, WBDec <dbl>, IndScore <dbl>, IndRank <dbl>,
## # IndDec <dbl>, OutScore <dbl>, OutRank <dbl>, OutDec <dbl>, TotPop <dbl>,
## # DepChi <dbl>, Pop16_59 <dbl>, Pop60_ <dbl>, WorkPop <dbl>,
## # Shape__Area <dbl>, Shape__Length <dbl>, LSOA11CD <chr>
lsoa_multidep_merged_sf <- merge(lsoa_sf_data, lsoa_multidep) #merging these
ggplot2::ggplot(lsoa_multidep_merged_sf) +
geom_sf(aes(fill=`IMDScore`))+ # which data set has the scores?
scale_fill_continuous(name="IMD Score", low="green",high="red")+
labs(caption ="Solent (all MSOAs)")
inFile<-paste0(dataFolder, "Fuel Poverty/2021 LSOA_Fuel_Poverty.csv")
lsoa_fuelpov_2021<-readr::read_csv (inFile)
## Warning: Missing column names filled in: 'X9' [9]
##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## `LSOA Code` = col_character(),
## `LSOA Name` = col_character(),
## `LA Code` = col_character(),
## `LA Name` = col_character(),
## Region = col_character(),
## `Number of households1` = col_number(),
## `Number of households in fuel poverty1` = col_double(),
## `Proportion of households fuel poor (%)` = col_double(),
## X9 = col_logical()
## )
## Warning: 1 parsing failure.
## row col expected actual file
## 32845 Proportion of households fuel poor (%) a double England '/Users/ben/University of Southampton/HCC Energy Landscape Mapping project - Documents/General/data/Fuel Poverty/2021 LSOA_Fuel_Poverty.csv'
head(lsoa_fuelpov_2021)
## # A tibble: 6 x 9
## `LSOA Code` `LSOA Name` `LA Code` `LA Name` Region `Number of househ…
## <chr> <chr> <chr> <chr> <chr> <dbl>
## 1 E01000001 City of London … E09000001 City of Lond… London 928
## 2 E01000002 City of London … E09000001 City of Lond… London 882
## 3 E01000003 City of London … E09000001 City of Lond… London 878
## 4 E01000005 City of London … E09000001 City of Lond… London 502
## 5 E01000006 Barking and Dag… E09000002 Barking and … London 587
## 6 E01000007 Barking and Dag… E09000002 Barking and … London 646
## # … with 3 more variables: Number of households in fuel poverty1 <dbl>,
## # Proportion of households fuel poor (%) <dbl>, X9 <lgl>
lsoa_fuelpov_2021$LSOA11CD <- lsoa_fuelpov_2021$"LSOA Code" #creating a variable with the LSOA code in the same name as in sf_data
lsoa_fuelpov_2021_merged <- merge(lsoa_sf_data, lsoa_fuelpov_2021) #merging these
# as above - why does it load as a char?
lsoa_fuelpov_2021_merged$pcFP <- as.numeric(lsoa_fuelpov_2021_merged$`Proportion of households fuel poor (%)`)
ggplot2::ggplot(lsoa_fuelpov_2021_merged) +
geom_sf(aes(fill=pcFP))+
scale_fill_continuous(name="Proportion of households fuel poor (%)", low="green",high="red")+
labs(caption ="Solent (all LSOAs)")
R.Version()
## $platform
## [1] "x86_64-apple-darwin17.0"
##
## $arch
## [1] "x86_64"
##
## $os
## [1] "darwin17.0"
##
## $system
## [1] "x86_64, darwin17.0"
##
## $status
## [1] ""
##
## $major
## [1] "4"
##
## $minor
## [1] "0.2"
##
## $year
## [1] "2020"
##
## $month
## [1] "06"
##
## $day
## [1] "22"
##
## $`svn rev`
## [1] "78730"
##
## $language
## [1] "R"
##
## $version.string
## [1] "R version 4.0.2 (2020-06-22)"
##
## $nickname
## [1] "Taking Off Again"